from flask import Blueprint, render_template, url_for
from core.api.Head import Head_uid, Head_pid, Heads_uid
from core.api.Images import Images_uid, Images_pid
from core.api.Line import Line_uid
from core.api.Reader import Reader_pid

api_blueprint = Blueprint('api', __name__, url_prefix='/api')

@api_blueprint.route('/page/view/personal/<int:uid>', methods=['GET'])
def page_view_personal(uid):
    return render_template('page/view/personal.html', head=Head_uid(uid),heads=Heads_uid(uid),images=Images_uid(uid),line=Line_uid(uid))

@api_blueprint.route('/page/view/post/<int:pid>', methods=['GET'])
def page_view_post(pid):
    return render_template('page/view/post.html',head=Head_pid(pid),images=Images_pid(pid),reader=Reader_pid(pid))

@api_blueprint.route('/page/edit/personal/<int:uid>', methods=['GET','POST'])
def page_edit_personal(uid):
    return render_template('page/edit/personal.html')